<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f() {
            var num1 = prompt("请输入第一个数字");
            var num2 = prompt("请输入第二个数字");
            var max = num1>num2 ? num1:num2;
            return max;
        }
        var num3 = f();
        console.log("最大值为："+num3);

    </script>
</head>
<body>

</body>
</html>